fix(integration): preserve ai_skills on use for skills-mode Copilot#3551
Merged
mnriem merged 1 commit intoJul 15, 2026
Merged
Conversation
…github#3550) `specify integration use copilot` against a Copilot install configured with `--integration-options "--skills"` dropped `"ai_skills": true` from init-options.json and regenerated extension commands in the legacy `.agent.md`/`.prompt.md` layout, contradicting `integration.json`'s stored `parsed_options.skills: true`. `_update_init_options_for_integration` only inspected `SkillsIntegration` / the instance `_skills_mode` flag. On the `use` path no `setup()` runs, so the freshly-resolved Copilot instance has `_skills_mode == False` and the stored skills intent in `parsed_options` was ignored. Thread the resolved `parsed_options` through and treat `parsed_options["skills"]` as skills mode. Adds a regression test that resets the registry singleton's `_skills_mode` to simulate a fresh process (in-process singleton reuse otherwise masks the bug). Assisted-by: GitHub Copilot (model: Claude Opus 4.8, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 06fb6ae9-f444-4dfd-ab3f-d0669c5d0604
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a Copilot integration edge case where specify integration use copilot would incorrectly clear ai_skills in .specify/init-options.json for projects originally initialized with Copilot --skills, causing extensions to be regenerated into the legacy .github/agents/*.agent.md + .github/prompts/*.prompt.md layout alongside existing .github/skills/**/SKILL.md files.
Changes:
- Preserve skills-mode detection during
integration useby passing resolvedparsed_optionsinto_update_init_options_for_integration. - Teach
_update_init_options_for_integrationto detect skills mode viaSkillsIntegration, instance_skills_mode, orparsed_options["skills"](to cover Copilot’s skills mode on theusepath). - Add a regression test that reproduces issue #3550’s exact sequence and asserts
ai_skillsis preserved and no legacy-layout files are regenerated.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/integrations/_helpers.py |
Fixes ai_skills persistence by incorporating resolved parsed_options when updating init-options during integration use. |
tests/integrations/test_integration_subcommand.py |
Adds an end-to-end regression test covering init --skills → extension add → integration use copilot without regressing into legacy command layout. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Low
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3550
Problem
Running
specify integration use copilotagainst a Copilot integration installed with--integration-options "--skills"silently dropped"ai_skills": truefrom.specify/init-options.json, even though.specify/integration.jsonstill recordedparsed_options.skills: true. The two files then contradicted each other, and any skills-mode extension commands (e.g.git) were regenerated in the legacy.github/agents/*.agent.md+.github/prompts/*.prompt.mdlayout, coexisting with the existing.github/skills/speckit-*/SKILL.mdfiles.Reproduced exactly against current
main:Root cause
_update_init_options_for_integration(src/specify_cli/integrations/_helpers.py) decidedai_skillspurely fromisinstance(integration, SkillsIntegration)or the instance's_skills_modeflag. Copilot is not aSkillsIntegration; its skills mode lives inparsed_options["skills"]and only sets_skills_modeduringsetup(). On theusepath nosetup()runs, soget_integration("copilot")returns an instance with_skills_mode == False, and the already-resolvedparsed_optionswere never consulted — soai_skillswas popped. The downstream refresh then treated Copilot as non-skills and regenerated extension commands in the legacy layout.Fix
_set_default_integrationnow passes its resolvedparsed_optionsinto_update_init_options_for_integration.SkillsIntegrationor the instance_skills_modeorparsed_options["skills"](consistent with howinitandcommand_invocation_separatoralready detect it).Testing
test_use_preserves_copilot_skills_mode, which follows the issue's exact sequence and assertsai_skillssurvives and no legacy-layout files are produced. It resets the registry singleton's_skills_modeto faithfully simulate a fresh process — in-process test invocations otherwise reuse the singleton left in skills mode byinit, which masks the bug. Verified the test fails without the fix and passes with it.tests/integrations/test_integration_subcommand.py,test_integration_copilot.py, andtest_integration_base_skills.pyall pass (162 tests).This PR was authored by GitHub Copilot (model: Claude Opus 4.8) on behalf of @mnriem.